//
//  MqInfoListTableViewCell.m
//  Meiqi
//
//  Created by lanou on 16/1/11.
//  Copyright © 2016年 KFC. All rights reserved.
//

#import "MqInfoListTableViewCell.h"



@implementation MqInfoListTableViewCell




// 重写初始化方法
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self addSubViews];
        
    }
    
    return self;
}

- (void)addSubViews
{
    
    _picImageV = [[UIImageView alloc] initWithFrame:CGRectMake(kWidthBase * 10, kHeightBase * 10, kScreenWidth / 4, kScreenHeight / 8 - kHeightBase * 10 * 2)];
   // _picImageV.backgroundColor = [UIColor greenColor];
    [self.contentView addSubview:_picImageV];
    
    _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(_picImageV.right + kWidthBase * 10,_picImageV.top, kScreenWidth - _picImageV.width - 3 * kWidthBase * 10, _picImageV.height * 2 / 3)];
  //  _titleLabel.backgroundColor = [UIColor yellowColor];
    _titleLabel.numberOfLines = 0;
    [self.contentView addSubview:_titleLabel];
    
    _timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(_titleLabel.left, _titleLabel.bottom, _titleLabel.width / 2, _picImageV.height / 3)];
  //  _timeLabel.backgroundColor = [UIColor orangeColor];
    _timeLabel.font = [UIFont systemFontOfSize:10];
    [self.contentView addSubview:_timeLabel];
    
    _onclickLabel = [[UILabel alloc] initWithFrame:CGRectMake(_timeLabel.right, _timeLabel.top, _titleLabel.width / 2, _timeLabel.height)];
   // _onclickLabel.backgroundColor = [UIColor greenColor];
    _onclickLabel.textAlignment = NSTextAlignmentRight;
    _onclickLabel.font = [UIFont systemFontOfSize:10];
    [self.contentView addSubview:_onclickLabel];
    
}

- (void)setModel:(MqInfoListModel *)model
{
    _model = model;
    
    // 赋值
    [_picImageV sd_setImageWithURL:[NSURL URLWithString:model.titlePic] placeholderImage:[UIImage imageNamed:@"infoplaceholder"]];
    _titleLabel.text = model.title;
    _timeLabel.text = model.newstime;
    _onclickLabel.text = [NSString stringWithFormat:@"%@ 点击",model.onclick];
}





- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
